package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 新增套餐
     * @param setmealDish
     * */
    void add(SetmealDish setmealDish);

    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> selectBySetmealId(Long id);
    @Update("update setmeal_dish set dish_id=#{dishId},name=#{name},price=#{price} where id=#{id}")
    void update(SetmealDish setmealDish);

    @Select("select id from setmeal_dish where setmeal_id=#{setmealId}")
    Long[] selectId(Long setmealId);

    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
